/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package businessObjects;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author williamprado
 */
@Entity
@Table(name = "esquema")
@NamedQueries({
    @NamedQuery(name = "Esquema.findAll", query = "SELECT e FROM Esquema e"),
    @NamedQuery(name = "Esquema.findByIdEsquema", query = "SELECT e FROM Esquema e WHERE e.idEsquema = :idEsquema"),
    @NamedQuery(name = "Esquema.findByNombreEsquema", query = "SELECT e FROM Esquema e WHERE e.nombreEsquema = :nombreEsquema"),
    @NamedQuery(name = "Esquema.findByCostoDiario", query = "SELECT e FROM Esquema e WHERE e.costoDiario = :costoDiario"),
    @NamedQuery(name = "Esquema.findByFilas", query = "SELECT e FROM Esquema e WHERE e.filas = :filas")})
public class Esquema implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idEsquema")
    private Integer idEsquema;
    @Basic(optional = false)
    @Column(name = "nombreEsquema")
    private String nombreEsquema;
    @Basic(optional = false)
    @Column(name = "costoDiario")
    private float costoDiario;
    @Basic(optional = false)
    @Column(name = "filas")
    private int filas;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEsquema")
    private Collection<Pauta> pautaCollection;

    public Esquema() {
    }

    public Esquema(Integer idEsquema) {
        this.idEsquema = idEsquema;
    }

    public Esquema(Integer idEsquema, String nombreEsquema, float costoDiario, int filas) {
        this.idEsquema = idEsquema;
        this.nombreEsquema = nombreEsquema;
        this.costoDiario = costoDiario;
        this.filas = filas;
    }

    public Integer getIdEsquema() {
        return idEsquema;
    }

    public void setIdEsquema(Integer idEsquema) {
        this.idEsquema = idEsquema;
    }

    public String getNombreEsquema() {
        return nombreEsquema;
    }

    public void setNombreEsquema(String nombreEsquema) {
        this.nombreEsquema = nombreEsquema;
    }

    public float getCostoDiario() {
        return costoDiario;
    }

    public void setCostoDiario(float costoDiario) {
        this.costoDiario = costoDiario;
    }

    public int getFilas() {
        return filas;
    }

    public void setFilas(int filas) {
        this.filas = filas;
    }

    public Collection<Pauta> getPautaCollection() {
        return pautaCollection;
    }

    public void setPautaCollection(Collection<Pauta> pautaCollection) {
        this.pautaCollection = pautaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEsquema != null ? idEsquema.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Esquema)) {
            return false;
        }
        Esquema other = (Esquema) object;
        if ((this.idEsquema == null && other.idEsquema != null) || (this.idEsquema != null && !this.idEsquema.equals(other.idEsquema))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "businessObjects.Esquema[idEsquema=" + idEsquema + "]";
    }

}
